﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 组织结构基础输入参数
/// </summary>
public class departmentBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 部门编号
    /// </summary>
    public virtual string? DepartmentidCode { get; set; }
    
    /// <summary>
    /// 上级部门id
    /// </summary>
    public virtual long? SuperiorDepartmentId { get; set; }
    
    /// <summary>
    /// 部门名称
    /// </summary>
    public virtual string? DepartmentName { get; set; }
    
    /// <summary>
    /// 部门状态
    /// </summary>
    public virtual bool? DepartmentState { get; set; }
    
    /// <summary>
    /// 部门排序
    /// </summary>
    [Required(ErrorMessage = "部门排序不能为空")]
    public virtual int? DepartmentSort { get; set; }
    
    /// <summary>
    /// 描述
    /// </summary>
    public virtual string? Desc { get; set; }
    
}

/// <summary>
/// 组织结构分页查询输入参数
/// </summary>
public class PagedepartmentInput : BasePageInput
{
    /// <summary>
    /// 部门编号
    /// </summary>
    public string? DepartmentidCode { get; set; }
    
    /// <summary>
    /// 上级部门id
    /// </summary>
    public long? SuperiorDepartmentId { get; set; }
    
    /// <summary>
    /// 部门名称
    /// </summary>
    public string? DepartmentName { get; set; }
    
    /// <summary>
    /// 部门状态
    /// </summary>
    public bool? DepartmentState { get; set; }
    
    /// <summary>
    /// 部门排序
    /// </summary>
    public int? DepartmentSort { get; set; }
    
    /// <summary>
    /// 描述
    /// </summary>
    public string? Desc { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 组织结构增加输入参数
/// </summary>
public class AdddepartmentInput
{
    /// <summary>
    /// 部门编号
    /// </summary>
    [MaxLength(32, ErrorMessage = "部门编号字符长度不能超过32")]
    public string? DepartmentidCode { get; set; }
    
    /// <summary>
    /// 上级部门id
    /// </summary>
    public long? SuperiorDepartmentId { get; set; }
    
    /// <summary>
    /// 部门名称
    /// </summary>
    [MaxLength(32, ErrorMessage = "部门名称字符长度不能超过32")]
    public string? DepartmentName { get; set; }
    
    /// <summary>
    /// 部门状态
    /// </summary>
    public bool? DepartmentState { get; set; }
    
    /// <summary>
    /// 部门排序
    /// </summary>
    [Required(ErrorMessage = "部门排序不能为空")]
    public int? DepartmentSort { get; set; }
    
    /// <summary>
    /// 描述
    /// </summary>
    [MaxLength(32, ErrorMessage = "描述字符长度不能超过32")]
    public string? Desc { get; set; }
    
}

/// <summary>
/// 组织结构删除输入参数
/// </summary>
public class DeletedepartmentInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 组织结构更新输入参数
/// </summary>
public class UpdatedepartmentInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 部门编号
    /// </summary>    
    [MaxLength(32, ErrorMessage = "部门编号字符长度不能超过32")]
    public string? DepartmentidCode { get; set; }
    
    /// <summary>
    /// 上级部门id
    /// </summary>    
    public long? SuperiorDepartmentId { get; set; }
    
    /// <summary>
    /// 部门名称
    /// </summary>    
    [MaxLength(32, ErrorMessage = "部门名称字符长度不能超过32")]
    public string? DepartmentName { get; set; }
    
    /// <summary>
    /// 部门状态
    /// </summary>    
    public bool? DepartmentState { get; set; }
    
    /// <summary>
    /// 部门排序
    /// </summary>    
    [Required(ErrorMessage = "部门排序不能为空")]
    public int? DepartmentSort { get; set; }
    
    /// <summary>
    /// 描述
    /// </summary>    
    [MaxLength(32, ErrorMessage = "描述字符长度不能超过32")]
    public string? Desc { get; set; }
    
}

/// <summary>
/// 组织结构主键查询输入参数
/// </summary>
public class QueryByIddepartmentInput : DeletedepartmentInput
{
}


///111

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDatadepartmentInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 组织结构数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportdepartmentInput : BaseImportInput
{
    /// <summary>
    /// 部门编号
    /// </summary>
    [ImporterHeader(Name = "部门编号")]
    [ExporterHeader("部门编号", Format = "", Width = 25, IsBold = true)]
    public string? DepartmentidCode { get; set; }
    
    /// <summary>
    /// 上级部门id 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? SuperiorDepartmentId { get; set; }
    
    /// <summary>
    /// 上级部门id 文本
    /// </summary>
    [ImporterHeader(Name = "上级部门id")]
    [ExporterHeader("上级部门id", Format = "", Width = 25, IsBold = true)]
    public string SuperiorDepartmentDisplayName { get; set; }
    
    /// <summary>
    /// 部门名称
    /// </summary>
    [ImporterHeader(Name = "部门名称")]
    [ExporterHeader("部门名称", Format = "", Width = 25, IsBold = true)]
    public string? DepartmentName { get; set; }
    
    /// <summary>
    /// 部门状态
    /// </summary>
    [ImporterHeader(Name = "部门状态")]

    [ExporterHeader("部门状态", Format = "", Width = 25, IsBold = true)]
    public bool? DepartmentState { get; set; }
    
    /// <summary>
    /// 部门排序
    /// </summary>
    [ImporterHeader(Name = "*部门排序")]
    [ExporterHeader("*部门排序", Format = "", Width = 25, IsBold = true)]
    public int? DepartmentSort { get; set; }
    
    /// <summary>
    /// 描述
    /// </summary>
    [ImporterHeader(Name = "描述")]
    [ExporterHeader("描述", Format = "", Width = 25, IsBold = true)]
    public string? Desc { get; set; }
    
}
